home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / docastle.c < prev    next >
C/C++ Source or Header  |  2000-04-04  |  36KB  |  974 lines

  1. /***************************************************************************
  2.  
  3. Mr. Do's Castle memory map (preliminary)
  4.  
  5. FIRST CPU:
  6. 0000-7fff ROM
  7. 8000-97ff RAM
  8. 9800-99ff Sprites
  9. b000-b3ff Video RAM
  10. b400-b7ff Color RAM
  11.  
  12. read:
  13. a000-a008 data from second CPU
  14.  
  15. write:
  16. a000-a008 data for second CPU
  17. a800      Watchdog reset?
  18. e000      Trigger NMI on second CPU
  19.  
  20. SECOND CPU:
  21. 0000-3fff ROM
  22. 8000-87ff RAM
  23.  
  24. read:
  25. a000-a008 data from first CPU
  26. all the following ports can be read both from c00x and from c08x. I don't know
  27. what's the difference.
  28. c001      DSWB
  29. c081      coins per play
  30. c002      DSWA
  31.           bit 6-7 = lives
  32.           bit 5 = upright/cocktail (0 = upright)
  33.           bit 4 = difficulty of EXTRA (1 = easy)
  34.           bit 3 = unused?
  35.           bit 2 = RACK TEST
  36.           bit 0-1 = difficulty
  37. c003      IN0
  38.           bit 4-7 = joystick player 2
  39.           bit 0-3 = joystick player 1
  40. c004      flipscreen (proper cocktail mode implemented by Chad Hendrickson Aug 1, 1999)
  41. c005      IN1
  42.           bit 7 = START 2
  43.           bit 6 = unused
  44.           bit 5 = jump player 2
  45.           bit 4 = fire player 2
  46.           bit 3 = START 1
  47.           bit 2 = unused
  48.           bit 1 = jump player 1(same effect as fire)
  49.           bit 0 = fire player 1
  50. c085      during the boot sequence, clearing any of bits 0, 1, 3, 4, 5, 7 enters the
  51.           test mode, while clearing bit 2 or 6 seems to lock the machine.
  52. c007      IN2
  53.           bit 7 = unused
  54.           bit 6 = unused
  55.           bit 5 = COIN 2
  56.           bit 4 = COIN 1
  57.           bit 3 = PAUSE
  58.           bit 2 = SERVICE (keep pressed)
  59.           bit 1 = TEST (doesn't work?)
  60.           bit 0 = TILT
  61.  
  62. write:
  63. a000-a008 data for first CPU
  64. e000      sound port 1
  65. e400      sound port 2
  66. e800      sound port 3
  67. ec00      sound port 4
  68.  
  69.  
  70. Mr. Do Wild Ride / Mr. Do Run Run memory map (preliminary)
  71.  
  72. 0000-1fff ROM
  73. 2000-37ff RAM
  74. 3800-39ff Sprites
  75. 4000-9fff ROM
  76. a000-a008 Shared with second CPU
  77. b000-b3ff Video RAM
  78. b400-b7ff Color RAM
  79.  
  80. write:
  81. a800      Watchdog reset?
  82. b800      Trigger NMI on second CPU (?)
  83.  
  84. SECOND CPU:
  85. 0000-3fff ROM
  86. 8000-87ff RAM
  87.  
  88. read:
  89. e000-e008 data from first CPU
  90. c003      bit 0-3 = joystick
  91.           bit 4-7 = ?
  92. c004      flipscreen (proper cocktail mode implemented by Chad Hendrickson Aug 1, 1999)
  93. c005      bit 0 = fire
  94.           bit 1 = fire (again?!)
  95.           bit 2 = ?
  96.           bit 3 = START 1
  97.           bit 4-6 = ?
  98.           bit 4 = START 2
  99. c081      coins per play
  100.  
  101. write:
  102. e000-e008 data for first CPU
  103. a000      sound port 1
  104. a400      sound port 2
  105. a800      sound port 3
  106. ac00      sound port 4
  107.  
  108. ***************************************************************************/
  109.  
  110. #include "driver.h"
  111. #include "vidhrdw/generic.h"
  112.  
  113.  
  114.  
  115. READ_HANDLER( docastle_shared0_r );
  116. READ_HANDLER( docastle_shared1_r );
  117. WRITE_HANDLER( docastle_shared0_w );
  118. WRITE_HANDLER( docastle_shared1_w );
  119. WRITE_HANDLER( docastle_nmitrigger_w );
  120.  
  121. void docastle_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  122. void dorunrun_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  123. int docastle_vh_start(void);
  124. void docastle_vh_stop(void);
  125. void docastle_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  126. READ_HANDLER( docastle_flipscreen_off_r );
  127. READ_HANDLER( docastle_flipscreen_on_r );
  128. WRITE_HANDLER( docastle_flipscreen_off_w );
  129. WRITE_HANDLER( docastle_flipscreen_on_w );
  130.  
  131.  
  132. static struct MemoryReadAddress docastle_readmem[] =
  133. {
  134.     { 0x0000, 0x7fff, MRA_ROM },
  135.     { 0x8000, 0x97ff, MRA_RAM },
  136.     { 0xa000, 0xa008, docastle_shared0_r },
  137.     { 0xb800, 0xbbff, videoram_r }, /* mirror of video ram */
  138.     { 0xbc00, 0xbfff, colorram_r }, /* mirror of color ram */
  139.     { -1 }    /* end of table */
  140. };
  141.  
  142. static struct MemoryWriteAddress docastle_writemem[] =
  143. {
  144.     { 0x0000, 0x7fff, MWA_ROM },
  145.     { 0x8000, 0x97ff, MWA_RAM },
  146.     { 0x9800, 0x99ff, MWA_RAM, &spriteram, &spriteram_size },
  147.     { 0xa000, 0xa008, docastle_shared1_w },
  148.     { 0xa800, 0xa800, watchdog_reset_w },
  149.     { 0xb000, 0xb3ff, videoram_w, &videoram, &videoram_size },
  150.     { 0xb400, 0xb7ff, colorram_w, &colorram },
  151.     { 0xe000, 0xe000, docastle_nmitrigger_w },
  152.     { -1 }    /* end of table */
  153. };
  154.  
  155. static struct MemoryReadAddress dorunrun_readmem[] =
  156. {
  157.     { 0x0000, 0x1fff, MRA_ROM },
  158.     { 0x2000, 0x37ff, MRA_RAM },
  159.     { 0x4000, 0x9fff, MRA_ROM },
  160.     { 0xa000, 0xa008, docastle_shared0_r },
  161.     { -1 }    /* end of table */
  162. };
  163.  
  164. static struct MemoryWriteAddress dorunrun_writemem[] =
  165. {
  166.     { 0x0000, 0x1fff, MWA_ROM },
  167.     { 0x2000, 0x37ff, MWA_RAM },
  168.     { 0x3800, 0x39ff, MWA_RAM, &spriteram, &spriteram_size },
  169.     { 0x4000, 0x9fff, MWA_ROM },
  170.     { 0xa000, 0xa008, docastle_shared1_w },
  171.     { 0xb000, 0xb3ff, videoram_w, &videoram, &videoram_size },
  172.     { 0xb400, 0xb7ff, colorram_w, &colorram },
  173.     { 0xb800, 0xb800, docastle_nmitrigger_w },
  174.     { 0xa800, 0xa800, watchdog_reset_w },
  175.     { -1 }    /* end of table */
  176. };
  177.  
  178. static struct MemoryReadAddress docastle_readmem2[] =
  179. {
  180.     { 0x0000, 0x3fff, MRA_ROM },
  181.     { 0x8000, 0x87ff, MRA_RAM },
  182.     { 0xa000, 0xa008, docastle_shared1_r },
  183.     { 0xc003, 0xc003, input_port_0_r },
  184.     { 0xc083, 0xc083, input_port_0_r },
  185.     { 0xc005, 0xc005, input_port_1_r },
  186.     { 0xc085, 0xc085, input_port_1_r },
  187.     { 0xc007, 0xc007, input_port_2_r },
  188.     { 0xc087, 0xc087, input_port_2_r },
  189.     { 0xc002, 0xc002, input_port_3_r },
  190.     { 0xc082, 0xc082, input_port_3_r },
  191.     { 0xc001, 0xc001, input_port_4_r },
  192.     { 0xc081, 0xc081, input_port_4_r },
  193.     { 0xc004, 0xc004, docastle_flipscreen_off_r },
  194.     { 0xc084, 0xc084, docastle_flipscreen_on_r },
  195.     { -1 }    /* end of table */
  196. };
  197.  
  198. static struct MemoryWriteAddress docastle_writemem2[] =
  199. {
  200.     { 0x0000, 0x3fff, MWA_ROM },
  201.     { 0x8000, 0x87ff, MWA_RAM },
  202.     { 0xa000, 0xa008, docastle_shared0_w },
  203.     { 0xe000, 0xe000, SN76496_0_w },
  204.     { 0xe400, 0xe400, SN76496_1_w },
  205.     { 0xe800, 0xe800, SN76496_2_w },
  206.     { 0xec00, 0xec00, SN76496_3_w },
  207.     { 0xc004, 0xc004, docastle_flipscreen_off_w },
  208.     { 0xc084, 0xc084, docastle_flipscreen_on_w },
  209.     { -1 }    /* end of table */
  210. };
  211.  
  212. static struct MemoryReadAddress dorunrun_readmem2[] =
  213. {
  214.     { 0x0000, 0x3fff, MRA_ROM },
  215.     { 0x8000, 0x87ff, MRA_RAM },
  216.     { 0xc003, 0xc003, input_port_0_r },
  217.     { 0xc083, 0xc083, input_port_0_r },
  218.     { 0xc005, 0xc005, input_port_1_r },
  219.     { 0xc085, 0xc085, input_port_1_r },
  220.     { 0xc007, 0xc007, input_port_2_r },
  221.     { 0xc087, 0xc087, input_port_2_r },
  222.     { 0xc002, 0xc002, input_port_3_r },
  223.     { 0xc082, 0xc082, input_port_3_r },
  224.     { 0xc001, 0xc001, input_port_4_r },
  225.     { 0xc081, 0xc081, input_port_4_r },
  226.     { 0xc004, 0xc004, docastle_flipscreen_off_r },
  227.     { 0xc084, 0xc084, docastle_flipscreen_on_r },
  228.     { 0xe000, 0xe008, docastle_shared1_r },
  229.     { -1 }    /* end of table */
  230. };
  231.  
  232. static struct MemoryWriteAddress dorunrun_writemem2[] =
  233. {
  234.     { 0x0000, 0x3fff, MWA_ROM },
  235.     { 0x8000, 0x87ff, MWA_RAM },
  236.     { 0xa000, 0xa000, SN76496_0_w },
  237.     { 0xa400, 0xa400, SN76496_1_w },
  238.     { 0xa800, 0xa800, SN76496_2_w },
  239.     { 0xac00, 0xac00, SN76496_3_w },
  240.     { 0xc004, 0xc004, docastle_flipscreen_off_w },
  241.     { 0xc084, 0xc084, docastle_flipscreen_on_w },
  242.     { 0xe000, 0xe008, docastle_shared0_w },
  243.     { -1 }    /* end of table */
  244. };
  245.  
  246.  
  247.  
  248. /* Coinage used for all games */
  249. #define COINAGE_PORT \
  250.     PORT_START \
  251.     PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_B ) ) \
  252.     PORT_DIPSETTING(    0x06, DEF_STR( 4C_1C ) ) \
  253.     PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) ) \
  254.     PORT_DIPSETTING(    0x0a, DEF_STR( 2C_1C ) ) \
  255.     PORT_DIPSETTING(    0x07, DEF_STR( 3C_2C ) ) \
  256.     PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) ) \
  257.     PORT_DIPSETTING(    0x09, DEF_STR( 2C_3C ) ) \
  258.     PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) ) \
  259.     PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) ) \
  260.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) ) \
  261.     PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) ) \
  262.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) ) \
  263.     /* 0x01, 0x02, 0x03, 0x04, 0x05 all give 1 Coin/1 Credit */ \
  264.     PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_A ) ) \
  265.     PORT_DIPSETTING(    0x60, DEF_STR( 4C_1C ) ) \
  266.     PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) ) \
  267.     PORT_DIPSETTING(    0xa0, DEF_STR( 2C_1C ) ) \
  268.     PORT_DIPSETTING(    0x70, DEF_STR( 3C_2C ) ) \
  269.     PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) ) \
  270.     PORT_DIPSETTING(    0x90, DEF_STR( 2C_3C ) ) \
  271.     PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) ) \
  272.     PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) ) \
  273.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) ) \
  274.     PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) ) \
  275.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) ) \
  276.     /* 0x10, 0x20, 0x30, 0x40, 0x50 all give 1 Coin/1 Credit */
  277.  
  278.  
  279. INPUT_PORTS_START( docastle )
  280.     PORT_START    /* IN0 */
  281.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  282.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY )
  283.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY )
  284.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY )
  285.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
  286.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY | IPF_COCKTAIL )
  287.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY | IPF_COCKTAIL )
  288.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY | IPF_COCKTAIL )
  289.  
  290.     PORT_START    /* IN1 */
  291.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
  292.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
  293.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* reported as not used */
  294.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  295.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL ) /* reported as 2 Player Fire */
  296.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* reported as 2 Player Jump */
  297.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* reported as not used */
  298.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
  299.  
  300.     PORT_START    /* IN2 */
  301.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
  302.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* reported as test */
  303. /* coin input must be active for 32 frames to be consistently recognized */
  304.     PORT_BIT_IMPULSE( 0x04, IP_ACTIVE_LOW, IPT_COIN3, 32 )
  305.     PORT_DIPNAME( 0x08, 0x08, "Freeze" )
  306.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  307.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  308.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
  309.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
  310.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* reported as not used */
  311.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* reported as not used */
  312.  
  313.     PORT_START    /* DSW0 */
  314.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
  315.     PORT_DIPSETTING(    0x03, "Easy" )
  316.     PORT_DIPSETTING(    0x02, "Medium" )
  317.     PORT_DIPSETTING(    0x01, "Hard" )
  318.     PORT_DIPSETTING(    0x00, "Hardest" )
  319.     PORT_BITX(    0x04, 0x04, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Rack Test", KEYCODE_F1, IP_JOY_NONE )
  320.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  321.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  322.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )    /* flip screen? doesn't work */
  323.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  324.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  325.     PORT_DIPNAME( 0x10, 0x10, "Extra" )
  326.     PORT_DIPSETTING(    0x10, "Easy" )
  327.     PORT_DIPSETTING(    0x00, "Hard" )
  328.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  329.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  330.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  331.     PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) )
  332.     PORT_DIPSETTING(    0x00, "2" )
  333.     PORT_DIPSETTING(    0xc0, "3" )
  334.     PORT_DIPSETTING(    0x80, "4" )
  335.     PORT_DIPSETTING(    0x40, "5" )
  336.  
  337.     COINAGE_PORT
  338. INPUT_PORTS_END
  339.  
  340. INPUT_PORTS_START( dorunrun )
  341.     PORT_START    /* IN0 */
  342.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  343.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY )
  344.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY )
  345.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY )
  346.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
  347.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY | IPF_COCKTAIL )
  348.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY | IPF_COCKTAIL )
  349.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY | IPF_COCKTAIL )
  350.  
  351.     PORT_START    /* IN1 */
  352.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
  353.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
  354.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  355.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  356.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  357.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  358.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  359.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
  360.  
  361.     PORT_START    /* IN2 */
  362.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
  363.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Reported as Test */
  364. /* coin input must be active for 32 frames to be consistently recognized */
  365.     PORT_BIT_IMPULSE( 0x04, IP_ACTIVE_LOW, IPT_COIN3, 32 )
  366.     PORT_DIPNAME( 0x08, 0x08, "Freeze" )
  367.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  368.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  369.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
  370.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
  371.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  372.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  373.  
  374.     PORT_START    /* DSW0 */
  375.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
  376.     PORT_DIPSETTING(    0x03, "Easy" )
  377.     PORT_DIPSETTING(    0x02, "Medium" )
  378.     PORT_DIPSETTING(    0x01, "Hard" )
  379.     PORT_DIPSETTING(    0x00, "Hardest" )
  380.     PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) )
  381.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  382.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  383.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Flip_Screen ) )
  384.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  385.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  386.     PORT_DIPNAME( 0x10, 0x10, "Extra" )
  387.     PORT_DIPSETTING(    0x10, "Easy" )
  388.     PORT_DIPSETTING(    0x00, "Hard" )
  389.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  390.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  391.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  392.     PORT_DIPNAME( 0x40, 0x40, "Special" )
  393.     PORT_DIPSETTING(    0x40, "Given" )
  394.     PORT_DIPSETTING(    0x00, "Not Given" )
  395.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Lives ) )
  396.     PORT_DIPSETTING(    0x80, "3" )
  397.     PORT_DIPSETTING(    0x00, "5" )
  398.  
  399.     COINAGE_PORT
  400. INPUT_PORTS_END
  401.  
  402. INPUT_PORTS_START( dowild )
  403.     PORT_START    /* IN0 */
  404.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  405.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY )
  406.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY )
  407.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY )
  408.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
  409.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY | IPF_COCKTAIL )
  410.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY | IPF_COCKTAIL )
  411.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY | IPF_COCKTAIL )
  412.  
  413.     PORT_START    /* IN1 */
  414.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
  415.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
  416.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* reported as not used */
  417.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  418.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL ) /* reported as 2 Player Fire */
  419.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* reported as 2 Player Jump */
  420.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* reported as not used */
  421.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
  422.  
  423.     PORT_START    /* IN2 */
  424.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
  425.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* reported as test */
  426. /* coin input must be active for 32 frames to be consistently recognized */
  427.     PORT_BIT_IMPULSE( 0x04, IP_ACTIVE_LOW, IPT_COIN3, 32 )
  428.     PORT_DIPNAME( 0x08, 0x08, "Freeze" )
  429.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  430.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  431.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
  432.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
  433.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* reported as not used */
  434.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* reported as not used */
  435.  
  436.     PORT_START    /* DSW0 */
  437.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
  438.     PORT_DIPSETTING(    0x03, "Easy" )
  439.     PORT_DIPSETTING(    0x02, "Medium" )
  440.     PORT_DIPSETTING(    0x01, "Hard" )
  441.     PORT_DIPSETTING(    0x00, "Hardest" )
  442.     PORT_BITX(    0x04, 0x04, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Rack Test", KEYCODE_F1, IP_JOY_NONE )
  443.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  444.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  445.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Flip_Screen ) )
  446.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  447.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  448.     PORT_DIPNAME( 0x10, 0x10, "Extra" )
  449.     PORT_DIPSETTING(    0x10, "Easy" )
  450.     PORT_DIPSETTING(    0x00, "Hard" )
  451.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  452.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  453.  
  454. PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  455.     PORT_DIPNAME( 0x40, 0x40, "Special" )
  456.     PORT_DIPSETTING(    0x40, "Given" )
  457.     PORT_DIPSETTING(    0x00, "Not Given" )
  458.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Lives ) )
  459.     PORT_DIPSETTING(    0x80, "3" )
  460.     PORT_DIPSETTING(    0x00, "5" )
  461.  
  462.     COINAGE_PORT
  463. INPUT_PORTS_END
  464.  
  465. INPUT_PORTS_START( jjack )
  466.     PORT_START    /* IN0 */
  467.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  468.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY )
  469.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY )
  470.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY )
  471.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
  472.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_4WAY | IPF_COCKTAIL )
  473.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_4WAY | IPF_COCKTAIL )
  474.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_4WAY | IPF_COCKTAIL )
  475.  
  476.     PORT_START    /* IN1 */
  477.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
  478.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
  479.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* reported as not used */
  480.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  481.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL ) /* reported as 2 Player Fire */
  482.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* reported as 2 Player Jump */
  483.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* reported as not used */
  484.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
  485.  
  486.     PORT_START    /* IN2 */
  487.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
  488.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* reported as test */
  489. /* coin input must be active for 32 frames to be consistently recognized */
  490.     PORT_BIT_IMPULSE( 0x04, IP_ACTIVE_LOW, IPT_COIN3, 32 )
  491.     PORT_DIPNAME( 0x08, 0x08, "Freeze" )
  492.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  493.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  494.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
  495.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
  496.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* reported as not used */
  497.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* reported as not used */
  498.  
  499.     PORT_START    /* DSW0 */
  500.     PORT_DIPNAME( 0x03, 0x03, "Difficulty?" )
  501.     PORT_DIPSETTING(    0x03, "Easy" )
  502.     PORT_DIPSETTING(    0x02, "Medium" )
  503.     PORT_DIPSETTING(    0x01, "Hard" )
  504.     PORT_DIPSETTING(    0x00, "Hardest" )
  505.     PORT_BITX(    0x04, 0x04, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Rack Test", KEYCODE_F1, IP_JOY_NONE )
  506.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  507.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  508.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Flip_Screen ) )
  509.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  510.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  511.     PORT_DIPNAME( 0x10, 0x10, "Extra?" )
  512.     PORT_DIPSETTING(    0x10, "Easy" )
  513.     PORT_DIPSETTING(    0x00, "Hard" )
  514.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  515.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  516.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  517.     PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) )
  518.     PORT_DIPSETTING(    0x00, "2" )
  519.     PORT_DIPSETTING(    0xc0, "3" )
  520.     PORT_DIPSETTING(    0x80, "4" )
  521.     PORT_DIPSETTING(    0x40, "5" )
  522.  
  523.     COINAGE_PORT
  524. INPUT_PORTS_END
  525.  
  526. INPUT_PORTS_START( kickridr )
  527.     PORT_START    /* IN0 */
  528.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  529.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
  530.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY )
  531.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
  532.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  533.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
  534.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
  535.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
  536.  
  537.     PORT_START    /* IN1 */
  538.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
  539.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
  540.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  541.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  542.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  543.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  544.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  545.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
  546.  
  547.     PORT_START    /* IN2 */
  548.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
  549.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Reported as Test */
  550. /* coin input must be active for 32 frames to be consistently recognized */
  551.     PORT_BIT_IMPULSE( 0x04, IP_ACTIVE_LOW, IPT_COIN3, 32 )
  552.     PORT_DIPNAME( 0x08, 0x08, "Freeze" )
  553.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  554.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  555.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
  556.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )
  557.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  558.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  559.  
  560.     PORT_START    /* DSW0 */
  561.     PORT_DIPNAME( 0x03, 0x03, "Difficulty?" )
  562.     PORT_DIPSETTING(    0x03, "Easy" )
  563.     PORT_DIPSETTING(    0x02, "Medium" )
  564.     PORT_DIPSETTING(    0x01, "Hard" )
  565.     PORT_DIPSETTING(    0x00, "Hardest" )
  566.     PORT_BITX(    0x04, 0x04, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Rack Test", KEYCODE_F1, IP_JOY_NONE )
  567.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  568.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  569.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Flip_Screen ) )
  570.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  571.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  572.     PORT_DIPNAME( 0x10, 0x10, "DSW4" )
  573.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  574.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  575.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  576.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  577.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  578.     PORT_DIPNAME( 0x40, 0x40, "DSW2" )
  579.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  580.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  581.     PORT_DIPNAME( 0x80, 0x80, "DSW1" )
  582.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  583.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  584.  
  585.     COINAGE_PORT
  586. INPUT_PORTS_END
  587.  
  588.  
  589.  
  590. static struct GfxLayout charlayout =
  591. {
  592.     8,8,    /* 8*8 characters */
  593.     512,    /* 512 characters */
  594.     4,      /* 4 bits per pixel */
  595.     { 0, 1, 2, 3 }, /* the bitplanes are packed in one nibble */
  596.     { 0, 4, 8, 12, 16, 20, 24, 28 },
  597.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
  598.     32*8   /* every char takes 32 consecutive bytes */
  599. };
  600. static struct GfxLayout spritelayout =
  601. {
  602.     16,16,  /* 16*16 sprites */
  603.     256,    /* 256 sprites */
  604.     4,      /* 4 bits per pixel */
  605.     { 0, 1, 2, 3 }, /* the bitplanes are packed in one nibble */
  606.     { 0, 4, 8, 12, 16, 20, 24, 28,
  607.             32, 36, 40, 44, 48, 52, 56, 60 },
  608.     { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64,
  609.             8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 },
  610.     128*8  /* every sprite takes 128 consecutive bytes */
  611. };
  612.  
  613.  
  614.  
  615. static struct GfxDecodeInfo gfxdecodeinfo[] =
  616. {
  617.     { REGION_GFX1, 0, &charlayout,       0, 64 },
  618.     { REGION_GFX2, 0, &spritelayout, 64*16, 32 },
  619.     { -1 } /* end of array */
  620. };
  621.  
  622.  
  623.  
  624. static struct SN76496interface sn76496_interface =
  625. {
  626.     4,    /* 4 chips */
  627.     { 4000000, 4000000, 4000000, 4000000 },    /* 4 Mhz? */
  628.     { 25, 25, 25, 25 }
  629. };
  630.  
  631.  
  632.  
  633. static struct MachineDriver machine_driver_docastle =
  634. {
  635.     /* basic machine hardware */
  636.     {
  637.         {
  638.             CPU_Z80,
  639.             4000000,    /* 4 MHz */
  640.             docastle_readmem,docastle_writemem,0,0,
  641.             interrupt,1
  642.         },
  643.         {
  644.             CPU_Z80,
  645.             4000000,    /* 4 MHz */
  646.             docastle_readmem2,docastle_writemem2,0,0,
  647.             interrupt,8
  648.         }
  649.     },
  650.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  651.     1,    /* 1 CPU slice per frame - interleaving is forced when communication takes place */
  652.     0,
  653.  
  654.     /* video hardware */
  655.     32*8, 32*8, { 1*8, 31*8-1, 4*8, 28*8-1 },
  656.     gfxdecodeinfo,
  657.     258, 96*16,
  658.     docastle_vh_convert_color_prom,
  659.  
  660.     VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
  661.     0,
  662.     docastle_vh_start,
  663.     docastle_vh_stop,
  664.     docastle_vh_screenrefresh,
  665.  
  666.     /* sound hardware */
  667.     0,0,0,0,
  668.     {
  669.         {
  670.             SOUND_SN76496,
  671.             &sn76496_interface
  672.         }
  673.     }
  674. };
  675.  
  676. static struct MachineDriver machine_driver_dorunrun =
  677. {
  678.     /* basic machine hardware */
  679.     {
  680.         {
  681.             CPU_Z80,
  682.             4000000,    /* 4 Mhz */
  683.             dorunrun_readmem,dorunrun_writemem,0,0,
  684.             interrupt,1
  685.         },
  686.         {
  687.             CPU_Z80,
  688.             4000000,    /* 4 Mhz */
  689.             dorunrun_readmem2,dorunrun_writemem2,0,0,
  690.             interrupt,8
  691.         }
  692.     },
  693.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  694.     1,    /* 1 CPU slice per frame - interleaving is forced when communication takes place */
  695.     0,
  696.  
  697.     /* video hardware */
  698.     32*8, 32*8, { 1*8, 31*8-1, 4*8, 28*8-1 },
  699.     gfxdecodeinfo,
  700.     258, 96*16,
  701.     dorunrun_vh_convert_color_prom,
  702.  
  703.     VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
  704.     0,
  705.     docastle_vh_start,
  706.     docastle_vh_stop,
  707.     docastle_vh_screenrefresh,
  708.  
  709.     /* sound hardware */
  710.     0,0,0,0,
  711.     {
  712.         {
  713.             SOUND_SN76496,
  714.             &sn76496_interface
  715.         }
  716.     }
  717. };
  718.  
  719.  
  720.  
  721. /***************************************************************************
  722.  
  723.   Game driver(s)
  724.  
  725. ***************************************************************************/
  726.  
  727. ROM_START( docastle )
  728.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  729.     ROM_LOAD( "01p_a1.bin",   0x0000, 0x2000, 0x17c6fc24 )
  730.     ROM_LOAD( "01n_a2.bin",   0x2000, 0x2000, 0x1d2fc7f4 )
  731.     ROM_LOAD( "01l_a3.bin",   0x4000, 0x2000, 0x71a70ba9 )
  732.     ROM_LOAD( "01k_a4.bin",   0x6000, 0x2000, 0x479a745e )
  733.  
  734.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the second CPU */
  735.     ROM_LOAD( "07n_a0.bin",   0x0000, 0x4000, 0xf23b5cdb )
  736.  
  737.     ROM_REGION( 0x4000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  738.     ROM_LOAD( "03a_a5.bin",   0x0000, 0x4000, 0x0636b8f4 )
  739.  
  740.     ROM_REGION( 0x8000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  741.     ROM_LOAD( "04m_a6.bin",   0x0000, 0x2000, 0x3bbc9b26 )
  742.     ROM_LOAD( "04l_a7.bin",   0x2000, 0x2000, 0x3dfaa9d1 )
  743.     ROM_LOAD( "04j_a8.bin",   0x4000, 0x2000, 0x9afb16e9 )
  744.     ROM_LOAD( "04h_a9.bin",   0x6000, 0x2000, 0xaf24bce0 )
  745.  
  746.     ROM_REGION( 0x0400, REGION_PROMS )
  747.     ROM_LOAD( "09c.bin",      0x0000, 0x0200, 0x066f52bc ) /* color prom */
  748.     ROM_LOAD( "01d.bin",      0x0200, 0x0200, 0x2747ca77 ) /* ??? */
  749. ROM_END
  750.  
  751. ROM_START( docastl2 )
  752.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  753.     ROM_LOAD( "a1",           0x0000, 0x2000, 0x0d81fafc )
  754.     ROM_LOAD( "a2",           0x2000, 0x2000, 0xa13dc4ac )
  755.     ROM_LOAD( "a3",           0x4000, 0x2000, 0xa1f04ffb )
  756.     ROM_LOAD( "a4",           0x6000, 0x2000, 0x1fb14aa6 )
  757.  
  758.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the second CPU */
  759.     ROM_LOAD( "a10",          0x0000, 0x4000, 0x45f7f69b )
  760.  
  761.     ROM_REGION( 0x4000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  762.     ROM_LOAD( "03a_a5.bin",   0x0000, 0x4000, 0x0636b8f4 )
  763.  
  764.     ROM_REGION( 0x8000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  765.     ROM_LOAD( "04m_a6.bin",   0x0000, 0x2000, 0x3bbc9b26 )
  766.     ROM_LOAD( "04l_a7.bin",   0x2000, 0x2000, 0x3dfaa9d1 )
  767.     ROM_LOAD( "04j_a8.bin",   0x4000, 0x2000, 0x9afb16e9 )
  768.     ROM_LOAD( "04h_a9.bin",   0x6000, 0x2000, 0xaf24bce0 )
  769.  
  770.     ROM_REGION( 0x0400, REGION_PROMS )
  771.     ROM_LOAD( "09c.bin",      0x0000, 0x0200, 0x066f52bc ) /* color prom */
  772.     ROM_LOAD( "01d.bin",      0x0200, 0x0200, 0x2747ca77 ) /* ??? */
  773. ROM_END
  774.  
  775. ROM_START( douni )
  776.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  777.     ROM_LOAD( "dorev1.bin",   0x0000, 0x2000, 0x1e2cbb3c )
  778.     ROM_LOAD( "dorev2.bin",   0x2000, 0x2000, 0x18418f83 )
  779.     ROM_LOAD( "dorev3.bin",   0x4000, 0x2000, 0x7b9e2061 )
  780.     ROM_LOAD( "dorev4.bin",   0x6000, 0x2000, 0xe013954d )
  781.  
  782.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the second CPU */
  783.     ROM_LOAD( "dorev10.bin",  0x0000, 0x4000, 0x4b1925e3 )
  784.  
  785.     ROM_REGION( 0x4000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  786.     ROM_LOAD( "03a_a5.bin",   0x0000, 0x4000, 0x0636b8f4 )
  787.  
  788.     ROM_REGION( 0x8000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  789.     ROM_LOAD( "dorev6.bin",   0x0000, 0x2000, 0x9e335bf8 )
  790.     ROM_LOAD( "dorev7.bin",   0x2000, 0x2000, 0xf5d5701d )
  791.     ROM_LOAD( "dorev8.bin",   0x4000, 0x2000, 0x7143ca68 )
  792.     ROM_LOAD( "dorev9.bin",   0x6000, 0x2000, 0x893fc004 )
  793.  
  794.     ROM_REGION( 0x0400, REGION_PROMS )
  795.     ROM_LOAD( "dorevc9.bin",  0x0000, 0x0200, 0x96624ebe ) /* color prom */
  796.     ROM_LOAD( "01d.bin",      0x0200, 0x0200, 0x2747ca77 ) /* ??? */
  797. ROM_END
  798.  
  799. ROM_START( dorunruc )
  800.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  801.     ROM_LOAD( "rev-0-1.p1",   0x0000, 0x2000, 0x49906ebd )
  802.     ROM_LOAD( "rev-0-2.n1",   0x2000, 0x2000, 0xdbe3e7db )
  803.     ROM_LOAD( "rev-0-3.l1",   0x4000, 0x2000, 0xe9b8181a )
  804.     ROM_LOAD( "rev-0-4.k1",   0x6000, 0x2000, 0xa63d0b89 )
  805.  
  806.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the second CPU */
  807.     ROM_LOAD( "rev-0-2.n7",   0x0000, 0x4000, 0x6dac2fa3 )
  808.  
  809.     ROM_REGION( 0x4000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  810.     ROM_LOAD( "rev-0-5.a3",   0x0000, 0x4000, 0xe20795b7 )
  811.  
  812.     ROM_REGION( 0x8000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  813.     ROM_LOAD( "2764.m4",      0x0000, 0x2000, 0x4bb231a0 )
  814.     ROM_LOAD( "2764.l4",      0x2000, 0x2000, 0x0c08508a )
  815.     ROM_LOAD( "2764.j4",      0x4000, 0x2000, 0x79287039 )
  816.     ROM_LOAD( "2764.h4",      0x6000, 0x2000, 0x523aa999 )
  817.  
  818.     ROM_REGION( 0x0100, REGION_PROMS )
  819.     ROM_LOAD( "dorunrun.clr", 0x0000, 0x0100, 0xd5bab5d5 )
  820. ROM_END
  821.  
  822. ROM_START( dorunrun )
  823.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  824.     ROM_LOAD( "2764.p1",      0x0000, 0x2000, 0x95c86f8e )
  825.     ROM_LOAD( "2764.l1",      0x4000, 0x2000, 0xe9a65ba7 )
  826.     ROM_LOAD( "2764.k1",      0x6000, 0x2000, 0xb1195d3d )
  827.     ROM_LOAD( "2764.n1",      0x8000, 0x2000, 0x6a8160d1 )
  828.  
  829.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the second CPU */
  830.     ROM_LOAD( "27128.p7",     0x0000, 0x4000, 0x8b06d461 )
  831.  
  832.     ROM_REGION( 0x4000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  833.     ROM_LOAD( "27128.a3",     0x0000, 0x4000, 0x4be96dcf )
  834.  
  835.     ROM_REGION( 0x8000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  836.     ROM_LOAD( "2764.m4",      0x0000, 0x2000, 0x4bb231a0 )
  837.     ROM_LOAD( "2764.l4",      0x2000, 0x2000, 0x0c08508a )
  838.     ROM_LOAD( "2764.j4",      0x4000, 0x2000, 0x79287039 )
  839.     ROM_LOAD( "2764.h4",      0x6000, 0x2000, 0x523aa999 )
  840.  
  841.     ROM_REGION( 0x0100, REGION_PROMS )
  842.     ROM_LOAD( "dorunrun.clr", 0x0000, 0x0100, 0xd5bab5d5 )
  843. ROM_END
  844.  
  845. ROM_START( dorunru2 )
  846.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  847.     ROM_LOAD( "p1",           0x0000, 0x2000, 0x12a99365 )
  848.     ROM_LOAD( "l1",           0x4000, 0x2000, 0x38609287 )
  849.     ROM_LOAD( "k1",           0x6000, 0x2000, 0x099aaf54 )
  850.     ROM_LOAD( "n1",           0x8000, 0x2000, 0x4f8fcbae )
  851.  
  852.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the second CPU */
  853.     ROM_LOAD( "27128.p7",     0x0000, 0x4000, 0x8b06d461 )
  854.  
  855.     ROM_REGION( 0x4000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  856.     ROM_LOAD( "27128.a3",     0x0000, 0x4000, 0x4be96dcf )
  857.  
  858.     ROM_REGION( 0x8000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  859.     ROM_LOAD( "2764.m4",      0x0000, 0x2000, 0x4bb231a0 )
  860.     ROM_LOAD( "2764.l4",      0x2000, 0x2000, 0x0c08508a )
  861.     ROM_LOAD( "2764.j4",      0x4000, 0x2000, 0x79287039 )
  862.     ROM_LOAD( "2764.h4",      0x6000, 0x2000, 0x523aa999 )
  863.  
  864.     ROM_REGION( 0x0100, REGION_PROMS )
  865.     ROM_LOAD( "dorunrun.clr", 0x0000, 0x0100, 0xd5bab5d5 )
  866. ROM_END
  867.  
  868. ROM_START( spiero )
  869.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  870.     ROM_LOAD( "sp1.bin",      0x0000, 0x2000, 0x08d23e38 )
  871.     ROM_LOAD( "sp3.bin",      0x4000, 0x2000, 0xfaa0c18c )
  872.     ROM_LOAD( "sp4.bin",      0x6000, 0x2000, 0x639b4e5d )
  873.     ROM_LOAD( "sp2.bin",      0x8000, 0x2000, 0x3a29ccb0 )
  874.  
  875.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the second CPU */
  876.     ROM_LOAD( "27128.p7",     0x0000, 0x4000, 0x8b06d461 )
  877.  
  878.     ROM_REGION( 0x4000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  879.     ROM_LOAD( "sp5.bin",      0x0000, 0x4000, 0x1b704bb0 )
  880.  
  881.     ROM_REGION( 0x8000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  882.     ROM_LOAD( "sp6.bin",      0x0000, 0x2000, 0x00f893a7 )
  883.     ROM_LOAD( "sp7.bin",      0x2000, 0x2000, 0x173e5c6a )
  884.     ROM_LOAD( "sp8.bin",      0x4000, 0x2000, 0x2e66525a )
  885.     ROM_LOAD( "sp9.bin",      0x6000, 0x2000, 0x9c571525 )
  886.  
  887.     ROM_REGION( 0x0400, REGION_PROMS )
  888.     ROM_LOAD( "bprom1.bin",   0x0000, 0x0200, 0xfc1b66ff ) /* color prom */
  889.     ROM_LOAD( "bprom2.bin",   0x0200, 0x0200, 0x2747ca77 ) /* ??? */
  890. ROM_END
  891.  
  892. ROM_START( dowild )
  893.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  894.     ROM_LOAD( "w1",           0x0000, 0x2000, 0x097de78b )
  895.     ROM_LOAD( "w3",           0x4000, 0x2000, 0xfc6a1cbb )
  896.     ROM_LOAD( "w4",           0x6000, 0x2000, 0x8aac1d30 )
  897.     ROM_LOAD( "w2",           0x8000, 0x2000, 0x0914ab69 )
  898.  
  899.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the second CPU */
  900.     ROM_LOAD( "w10",          0x0000, 0x4000, 0xd1f37fba )
  901.  
  902.     ROM_REGION( 0x4000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  903.     ROM_LOAD( "w5",           0x0000, 0x4000, 0xb294b151 )
  904.  
  905.     ROM_REGION( 0x8000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  906.     ROM_LOAD( "w6",           0x0000, 0x2000, 0x57e0208b )
  907.     ROM_LOAD( "w7",           0x2000, 0x2000, 0x5001a6f7 )
  908.     ROM_LOAD( "w8",           0x4000, 0x2000, 0xec503251 )
  909.     ROM_LOAD( "w9",           0x6000, 0x2000, 0xaf7bd7eb )
  910.  
  911.     ROM_REGION( 0x0100, REGION_PROMS )
  912.     ROM_LOAD( "dowild.clr",   0x0000, 0x0100, 0xa703dea5 )
  913. ROM_END
  914.  
  915. ROM_START( jjack )
  916.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  917.     ROM_LOAD( "j1.bin",       0x0000, 0x2000, 0x87f29bd2 )
  918.     ROM_LOAD( "j3.bin",       0x4000, 0x2000, 0x35b0517e )
  919.     ROM_LOAD( "j4.bin",       0x6000, 0x2000, 0x35bb316a )
  920.     ROM_LOAD( "j2.bin",       0x8000, 0x2000, 0xdec52e80 )
  921.  
  922.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the second CPU */
  923.     ROM_LOAD( "j0.bin",       0x0000, 0x4000, 0xab042f04 )
  924.  
  925.     ROM_REGION( 0x4000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  926.     ROM_LOAD( "j5.bin",       0x0000, 0x4000, 0x75038ff9 )
  927.  
  928.     ROM_REGION( 0x8000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  929.     ROM_LOAD( "j6.bin",       0x0000, 0x2000, 0x5937bd7b )
  930.     ROM_LOAD( "j7.bin",       0x2000, 0x2000, 0xcf8ae8e7 )
  931.     ROM_LOAD( "j8.bin",       0x4000, 0x2000, 0x84f6fc8c )
  932.     ROM_LOAD( "j9.bin",       0x6000, 0x2000, 0x3f9bb09f )
  933.  
  934.     ROM_REGION( 0x0400, REGION_PROMS )
  935.     ROM_LOAD( "bprom1.bin",   0x0000, 0x0200, 0x2f0955f2 ) /* color prom */
  936.     ROM_LOAD( "bprom2.bin",   0x0200, 0x0200, 0x2747ca77 ) /* ??? */
  937. ROM_END
  938.  
  939. ROM_START( kickridr )
  940.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  941.     ROM_LOAD( "k1",           0x0000, 0x2000, 0xdfdd1ab4 )
  942.     ROM_LOAD( "k3",           0x4000, 0x2000, 0x412244da )
  943.     ROM_LOAD( "k4",           0x6000, 0x2000, 0xa67dd2ec )
  944.     ROM_LOAD( "k2",           0x8000, 0x2000, 0xe193fb5c )
  945.  
  946.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the second CPU */
  947.     ROM_LOAD( "k10",          0x0000, 0x4000, 0x6843dbc0 )
  948.  
  949.     ROM_REGION( 0x4000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  950.     ROM_LOAD( "k5",           0x0000, 0x4000, 0x3f7d7e49 )
  951.  
  952.     ROM_REGION( 0x8000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  953.     ROM_LOAD( "k6",           0x0000, 0x2000, 0x94252ed3 )
  954.     ROM_LOAD( "k7",           0x2000, 0x2000, 0x7ef2420e )
  955.     ROM_LOAD( "k8",           0x4000, 0x2000, 0x29bed201 )
  956.     ROM_LOAD( "k9",           0x6000, 0x2000, 0x847584d3 )
  957.  
  958.     ROM_REGION( 0x0100, REGION_PROMS )
  959.     ROM_LOAD( "kickridr.clr", 0x0000, 0x0100, 0x73ec281c )
  960. ROM_END
  961.  
  962.  
  963.  
  964. GAME( 1983, docastle, 0,        docastle, docastle, 0, ROT270, "Universal", "Mr. Do's Castle (set 1)" )
  965. GAME( 1983, docastl2, docastle, docastle, docastle, 0, ROT270, "Universal", "Mr. Do's Castle (set 2)" )
  966. GAME( 1983, douni,    docastle, docastle, docastle, 0, ROT270, "Universal", "Mr. Do vs. Unicorns" )
  967. GAME( 1984, dorunrun, 0,        dorunrun, dorunrun, 0, ROT0,   "Universal", "Do! Run Run (set 1)" )
  968. GAME( 1984, dorunru2, dorunrun, dorunrun, dorunrun, 0, ROT0,   "Universal", "Do! Run Run (set 2)" )
  969. GAME( 1984, dorunruc, dorunrun, docastle, dorunrun, 0, ROT0,   "Universal", "Do! Run Run (Do's Castle hardware)" )
  970. GAME( 1987, spiero,   dorunrun, dorunrun, dorunrun, 0, ROT0,   "Universal", "Super Pierrot (Japan)" )
  971. GAME( 1984, dowild,   0,        dorunrun, dowild,   0, ROT0,   "Universal", "Mr. Do's Wild Ride" )
  972. GAME( 1984, jjack,    0,        dorunrun, jjack,    0, ROT270, "Universal", "Jumping Jack" )
  973. GAME( 1984, kickridr, 0,        dorunrun, kickridr, 0, ROT0,   "Universal", "Kick Rider" )
  974.